<?php


namespace app\common\caches;


use think\facade\Cache;

class DiaryLabelCache
{
    public static function setFetchList(int $user_id, $data)
    {
        return Cache::tag("user:{$user_id}.diary.labels")->set("user:{$user_id}.diary.labels", $data, 60*60*24);
    }

    public static function getFetchList(int $user_id)
    {
        return Cache::get("user:{$user_id}.diary.labels");
    }

    // 移除查询结果
    public static function removeQueryData(int $user_id)
    {
        return Cache::tag("user:{$user_id}.diary.labels")->clear();
    }
}
